<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1 th:object="${user}">欢迎您：
        <p><span th:text="*{name}">请登入</span>.</p>
        <p><span th:text="*{age}">请登入</span>.</p>
        <p><span th:text="*{friend.name}">请登入</span>.</p>
        <h1 th:text="'欢迎'+ ${user.name}+'!'"></h1>
        <h th:text="|欢迎*{name}+*{age}|"></h>
        <p><span th:text="*{age}*2==0"></span></p>
        <span th:text="*{age}*2"></span>
        <span th:text="${user.name} ?: '二狗'"></span>
    </h1>
    <h2 th:each="user : ${users}">
        <td th:text="${user.name}"></td>
    </h2>
    <h1><span th:unless="${user.age} < 24">小鲜肉</span></h1>
    <div th:switch="${user.name}">
        <p th:case="'MIMI'">用户是管理员</p>
        <p th:case="'manager'">用户是经理</p>
        <p th:case="*">用户是别的玩意</p>
    </div>

    <script th:inline="javascript">
        const user = /*[[${user}]]*/ {};
        const age = /*[[${user.age}]]*/ 20;
        console.log(user);
        console.log(age)
    </script>
</body>
</html>